﻿namespace AiQiuQuan.Sport.Model
{
    /// <summary>
    /// 周扩展
    /// </summary>
    public static class WeekDayExtensions
    {
        /// <summary>
        /// 返回周几，ex:周一
        /// </summary>
        /// <param name="weekday"></param>
        /// <returns></returns>
        public static string WeekDayToString(this DayOfWeek weekday)
        {
            switch (weekday)
            {
                case DayOfWeek.Monday:
                    return "周一";
                case DayOfWeek.Tuesday:
                    return "周二";
                case DayOfWeek.Wednesday:
                    return "周三";
                case DayOfWeek.Thursday:
                    return "周四";
                case DayOfWeek.Friday:
                    return "周五";
                case DayOfWeek.Saturday:
                    return "周六";
                case DayOfWeek.Sunday:
                    return "周日";
            }

            return weekday.ToString();
        }
    }
}
